<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of robro_modelo
 *
 * @author jose
 */
class Recibo_detalle extends CI_Model {

    //put your code here
    public function guardar($data) {
        $this->db->insert("recibo_detalle", $data);
        return $this->db->insert_id(); 
    }
    

    
    public function elimina($matriculas_id_matr) {
        $this->db->where('matriculas_id_matr',$matriculas_id_matr);
        $this->db->delete("recibo_detalle"); 
    }
    public function getdatos($matriculas_id_matr) {
        $this->db->from('recibo_detalle');
        $this->db->where('matriculas_id_matr',$matriculas_id_matr);
        $query = $this->db->get();
        $data=array();
        if ($query->num_rows() > 0) {
            foreach ($query->result_array() as $row) {
                $data[] = $row; //$row;
            }
        }
        $query->free_result();
        return $data;        
    }    

    
}

/*
SELECT
    `matriculas`.`forma_pago`
    , `matriculas`.`monto_canc_matr`
    , `matriculas`.`nro_recibo_mat`
    , `matriculas`.`tipo_doc_pago_mat`
    , `matriculas`.`nom_doc_pago_mat`
    , `matriculas`.`nro_comp_pago_mat`
    , `matriculas`.`lote_doc_pago_mat`
    , `matriculas`.`ref_doc_pago_mat`
    , `matriculas`.`monto_efec_doc_pago`
    , `matriculas`.`monto_rest_doc_pago`
    ,sacitss.`recibo_detalle`.*
FROM
    `sacitss`.`matriculas`
    INNER JOIN `sacitss`.`recibo_detalle` 
        ON (`matriculas`.`id_matr` = `recibo_detalle`.`matriculas_id_matr`)
WHERE (`matriculas`.`id_matr` =4724);
*/

?>
